﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.IO;
using System.Runtime.Serialization;

namespace Buffered_Response
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IStreamingService
    {

        [OperationContract]
        [FaultContract(typeof(IOException))]
        Stream GetData(string FileName);


        [OperationContract]
        [FaultContract(typeof(IOException))]
        ChunkedDataResult GetDataChunk(string FileName, int Offset);

        // TODO: Add your service operations here
    }


    // Use a data contract as illustrated in the sample below to add composite types to service operations.
    [DataContract]
    public struct ChunkedDataResult
    {
        [DataMember]
        public byte[] ChunkedBlock;
        [DataMember]
        public long StreamSize;
    }
}
